//
//  CityModel.m
//  Shengzhuli
//
//  Created by 卡忙科技 on 16/8/4.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "CityModel.h"

@implementation CityModel

- (CityModel *)initWithDict:(NSDictionary *)dict
{
    if (self = [super init]) {
        self.firstLetter = dict[@"firstLetter"];
        self.ID = [dict[@"id"] integerValue];
        self.name = dict[@"name"];
        self.parentId = dict[@"parentId"];
    }
    return self;
}
- (instancetype)init
{
    self = [super init];
    self.name = @"";
    return self;
}

+ (instancetype)cityWithDict:(NSDictionary *)dict
{
    return [[CityModel alloc]initWithDict:dict];
}
//- (void)encodeWithCoder:(NSCoder *)encoder
//{
//    [encoder encodeObject:self.firstLetter forKey:@"firstLetter"];
//    [encoder encodeObject:self.name forKey:@"name"];
//    [encoder encodeObject:self.parentId forKey:@"parentId"];
//    [encoder encodeObject:@(self.ID) forKey:@"ID"];
//}
//- (nullable instancetype)initWithCoder:(NSCoder *)decoder
//{
//    if (self = [super init]) {
//        self.firstLetter = [decoder decodeObjectForKey:@"firstLetter"];
//        self.name = [decoder decodeObjectForKey:@"name"];
//        self.parentId = [decoder decodeObjectForKey:@"parentId"];
//        self.ID = [[decoder decodeObjectForKey:@"ID"] integerValue];
//    }
//    return self;
//}


@end
